<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>BFC</title>
    <style>
        .box1 {
            /*浮动触发bfc*/
            float: left;
            width: 200px;
            height: 200px;
            background-color: blue;
            text-align: right;
        }

        .box2 {

            width: 500px;

            height: 300px;
            background-color: yellow;
        }

    </style>
</head>
<body>

<div class="box1">右侧文字</div>
<div class="box2">左侧文字</div>

</body>
</html>